<html>
<head><meta charset="utf-8"><title>ninja · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html">ninja</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="208511579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/208511579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#208511579">(Aug 31 2020 at 00:38)</a>:</h4>
<p>This is new:</p>
<div class="codehilite"><pre><span></span><code>Couldn&#39;t find required command: ninja
You should install ninja, or set ninja=false in config.toml
</code></pre></div>



<a name="208511581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/208511581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#208511581">(Aug 31 2020 at 00:38)</a>:</h4>
<p>Hmm, <code>sudo apt install ninja</code> doesn't find a package</p>



<a name="208511592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/208511592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#208511592">(Aug 31 2020 at 00:39)</a>:</h4>
<p><code>ninja-build</code>, maybe</p>



<a name="208511595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/208511595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#208511595">(Aug 31 2020 at 00:39)</a>:</h4>
<p>ninja-build is it, yeah</p>



<a name="208511596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/208511596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#208511596">(Aug 31 2020 at 00:39)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/74922">https://github.com/rust-lang/rust/pull/74922</a></p>



<a name="208511947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/208511947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#208511947">(Aug 31 2020 at 00:48)</a>:</h4>
<p>I just tried building the same way I always do:</p>
<div class="codehilite"><pre><span></span><code>thread &#39;main&#39; panicked at &#39;error: no rules matched src/rustc&#39;, src/bootstrap/builder.rs:235:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failed to run: /home/njn/moz/rust0/build/bootstrap/debug/bootstrap build --stage 2 src/rustc
</code></pre></div>



<a name="208511957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/208511957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#208511957">(Aug 31 2020 at 00:49)</a>:</h4>
<p>/me sighs</p>



<a name="208511969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/208511969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#208511969">(Aug 31 2020 at 00:49)</a>:</h4>
<p>that's <a href="https://github.com/rust-lang/rust/pull/74862">https://github.com/rust-lang/rust/pull/74862</a> <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="209147959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209147959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209147959">(Sep 04 2020 at 22:53)</a>:</h4>
<p>(would prefer having this discussion on the mcp thread so that all the feedback is one place <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span> )</p>



<a name="209148323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209148323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209148323">(Sep 04 2020 at 22:59)</a>:</h4>
<p>can we edit the topic so it's in one place?</p>



<a name="209432387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432387">(Sep 08 2020 at 19:25)</a>:</h4>
<div class="codehilite"><pre><span></span><code>CMake Error: Error: generator : Ninja
Does not match the generator used previously: Unix Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
thread &#39;main&#39; panicked at &#39;
command did not execute successfully, got: exit code: 1
</code></pre></div>



<a name="209432445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432445">(Sep 08 2020 at 19:25)</a>:</h4>
<p>what are the possible solutions for this?</p>



<a name="209432526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432526">(Sep 08 2020 at 19:26)</a>:</h4>
<p>probably rm -rf build/&lt;triple&gt;/llvm</p>



<a name="209432535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432535">(Sep 08 2020 at 19:26)</a>:</h4>
<p>I guess one is <code>rm -rf build</code>, I could do that later today but ... well investigating the commits to see what ...</p>



<a name="209432537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432537">(Sep 08 2020 at 19:26)</a>:</h4>
<p>ok :)</p>



<a name="209432572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432572">(Sep 08 2020 at 19:26)</a>:</h4>
<p>we switch the default to ninja but I guess llvm deals poorly with that transition :/</p>



<a name="209432588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432588">(Sep 08 2020 at 19:27)</a>:</h4>
<p>cmake, really</p>



<a name="209432591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432591">(Sep 08 2020 at 19:27)</a>:</h4>
<p><em>hopefully</em> you could just remove the CMakeCache.txt file</p>



<a name="209432625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432625">(Sep 08 2020 at 19:27)</a>:</h4>
<p>but not sure if that runs into other weirdness</p>



<a name="209432687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432687">(Sep 08 2020 at 19:27)</a>:</h4>
<p>I think that file is not just in one place? I don't know cmake that well.</p>



<a name="209432742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432742">(Sep 08 2020 at 19:28)</a>:</h4>
<div class="codehilite"><pre><span></span><code>[santiago@galago rust1 (rust1)]$ find . -name &#39;CMakeCache.txt&#39;
./build/x86_64-unknown-linux-gnu/llvm/build/CMakeCache.txt
</code></pre></div>



<a name="209432775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432775">(Sep 08 2020 at 19:28)</a>:</h4>
<p>yeah, removed it and <code>./x.py clean</code> works, let's see if it builds</p>



<a name="209432785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432785">(Sep 08 2020 at 19:28)</a>:</h4>
<p>later I can remove everything but I don't want to wait now :)</p>



<a name="209432792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432792">(Sep 08 2020 at 19:28)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/131828-t-compiler/topic/ninja/near/209432687">said</a>:</p>
<blockquote>
<p>I think that file is not just in one place? I don't know cmake that well.</p>
</blockquote>
<p>the cache is different from <code>CMakeLists.txt</code>, those are in every directory</p>



<a name="209432798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432798">(Sep 08 2020 at 19:28)</a>:</h4>
<p>oh x.py clean doesn't... well, do anything to llvm</p>



<a name="209432833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209432833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209432833">(Sep 08 2020 at 19:29)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/131828-t-compiler/topic/ninja/near/209432798">said</a>:</p>
<blockquote>
<p>oh x.py clean doesn't... well, do anything to llvm</p>
</blockquote>
<p>yeah but it was giving that error, I meant, I understand what you meant</p>



<a name="209433097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209433097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209433097">(Sep 08 2020 at 19:31)</a>:</h4>
<p>well nothing seem to be working properly</p>



<a name="209433138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209433138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209433138">(Sep 08 2020 at 19:31)</a>:</h4>
<p><code>rm -rf build</code> :)</p>



<a name="209433626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209433626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209433626">(Sep 08 2020 at 19:36)</a>:</h4>
<p>rm -rf build/&lt;triple&gt;/llvm not working is a sign something is quite wrong, that should've definitely worked and saved you a good chunk of time, presuming the rest of rustc was already built</p>



<a name="209440765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209440765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209440765">(Sep 08 2020 at 20:35)</a>:</h4>
<p>well, after removing everything and recompiling ...</p>



<a name="209440776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209440776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209440776">(Sep 08 2020 at 20:35)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error: internal compiler error: src/librustc_mir/monomorphize/collector.rs:802:9: cannot create local mono-item for DefId(1:313 ~ std[8a26]::thread[0]::local[0]::{{impl}}[4]::with[0])

thread &#39;rustc&#39; panicked at &#39;Box&lt;Any&gt;&#39;, src/librustc_errors/lib.rs:918:9
stack backtrace:
   Compiling annotate-snippets v0.8.0
   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::bug
   2: rustc_errors::Handler::bug
   3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
   4: rustc_middle::ty::context::tls::with_opt::{{closure}}
   5: rustc_middle::ty::context::tls::with_opt
   6: rustc_middle::util::bug::opt_span_bug_fmt
   7: rustc_middle::util::bug::bug_fmt
   8: rustc_mir::monomorphize::collector::should_codegen_locally
   9: &lt;rustc_mir::monomorphize::collector::MirNeighborCollector as rustc_middle::mir::visit::Visitor&gt;::visit_terminator
  10: rustc_mir::monomorphize::collector::collect_neighbours
  11: rustc_mir::monomorphize::collector::collect_items_rec
  12: rustc_session::utils::&lt;impl rustc_session::session::Session&gt;::time
  13: rustc_mir::monomorphize::collector::collect_crate_mono_items
  14: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  15: rustc_middle::ty::query::&lt;impl rustc_query_system::query::config::QueryAccessors&lt;rustc_middle::ty::context::TyCtxt&gt; for rustc_middle::ty::query::queries::collect_and_partition_mono_items&gt;::compute
  16: rustc_query_system::dep_graph::graph::DepGraph&lt;K&gt;::with_task_impl
  17: rustc_data_structures::stack::ensure_sufficient_stack
  18: rustc_query_system::query::plumbing::get_query_impl
  19: rustc_codegen_ssa::base::codegen_crate
  20: &lt;rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend&gt;::codegen_crate
  21: rustc_interface::passes::QueryContext::enter
  22: rustc_interface::queries::Queries::ongoing_codegen
  23: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::enter
  24: rustc_span::with_source_map
  25: rustc_interface::interface::create_compiler_and_run
  26: scoped_tls::ScopedKey&lt;T&gt;::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&amp;template=ice.md

note: rustc 1.47.0-beta.1 (0f91f5c28 2020-08-25) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z macro-backtrace -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C codegen-units=8 -C debuginfo=1 -C debug-assertions=on -C overflow-checks=off -C link-args=-Wl,-rpath,$ORIGIN/../lib -C prefer-dynamic -C llvm-args=-import-instr-limit=10 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: aborting due to previous error

error: could not compile `scoped-tls`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: internal compiler error: src/librustc_mir/monomorphize/collector.rs:802:9: cannot create local mono-item for DefId(1:6531 ~ core[9f45]::fmt[0]::{{impl}}[7]::debug_struct[0])

thread &#39;rustc&#39; panicked at &#39;Box&lt;Any&gt;&#39;, src/librustc_errors/lib.rs:918:9
stack backtrace:
error: internal compiler error: src/librustc_mir/monomorphize/collector.rs:802:9: cannot create local mono-item for DefId(5:3732 ~ alloc[eb11]::str[0]::{{impl}}[5]::replace[0])

thread &#39;rustc&#39; panicked at &#39;Box&lt;Any&gt;&#39;, src/librustc_errors/lib.rs:918:9
stack backtrace:
error: internal compiler error: src/librustc_mir/monomorphize/collector.rs:802:9: cannot create local mono-item for DefId(1:6985 ~ core[9f45]::slice[0]::{{impl}}[0]::binary_search_by[0])

thread &#39;rustc&#39; panicked at &#39;Box&lt;Any&gt;&#39;, src/librustc_errors/lib.rs:918:9
stack backtrace:
   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::bug
   2: rustc_errors::Handler::bug
   3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
   4: rustc_middle::ty::context::tls::with_opt::{{closure}}
   5: rustc_middle::ty::context::tls::with_opt
   6: rustc_middle::util::bug::opt_span_bug_fmt
   7: rustc_middle::util::bug::bug_fmt
   8: rustc_mir::monomorphize::collector::should_codegen_locally
   9: &lt;rustc_mir::monomorphize::collector::MirNeighborCollector as rustc_middle::mir::visit::Visitor&gt;::visit_terminator
  10: rustc_mir::monomorphize::collector::collect_neighbours
  11: rustc_mir::monomorphize::collector::collect_items_rec
  12: rustc_session::utils::&lt;impl rustc_session::session::Session&gt;::time
  13: rustc_mir::monomorphize::collector::collect_crate_mono_items
  14: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  15: rustc_middle::ty::query::&lt;impl rustc_query_system::query::config::QueryAccessors&lt;rustc_middle::ty::context::TyCtxt&gt; for rustc_middle::ty::query::queries::collect_and_partition_mono_items&gt;::compute
  16: rustc_query_system::dep_graph::graph::DepGraph&lt;K&gt;::with_task_impl
  17: rustc_data_structures::stack::ensure_sufficient_stack
  18: rustc_query_system::query::plumbing::get_query_impl
  19: rustc_codegen_ssa::base::codegen_crate
  20: &lt;rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend&gt;::codegen_crate
  21: rustc_interface::passes::QueryContext::enter
  22: rustc_interface::queries::Queries::ongoing_codegen
  23: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::enter
  24: rustc_span::with_source_map
  25: rustc_interface::interface::create_compiler_and_run
  26: scoped_tls::ScopedKey&lt;T&gt;::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&amp;template=ice.md

note: rustc 1.47.0-beta.1 (0f91f5c28 2020-08-25) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z macro-backtrace -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C codegen-units=8 -C debuginfo=1 -C debug-assertions=on -C overflow-checks=off -C link-args=-Wl,-rpath,$ORIGIN/../lib -C prefer-dynamic -C llvm-args=-import-instr-limit=10 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: aborting due to previous error

   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::bug
   2: rustc_errors::Handler::bug
   3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
   4: rustc_middle::ty::context::tls::with_opt::{{closure}}
   5: rustc_middle::ty::context::tls::with_opt
   6: rustc_middle::util::bug::opt_span_bug_fmt
   7: rustc_middle::util::bug::bug_fmt
   8: rustc_mir::monomorphize::collector::should_codegen_locally
   9: &lt;rustc_mir::monomorphize::collector::MirNeighborCollector as rustc_middle::mir::visit::Visitor&gt;::visit_terminator
  10: rustc_mir::monomorphize::collector::collect_neighbours
  11: rustc_mir::monomorphize::collector::collect_items_rec
  12: rustc_session::utils::&lt;impl rustc_session::session::Session&gt;::time
  13: rustc_mir::monomorphize::collector::collect_crate_mono_items
  14: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  15: rustc_middle::ty::query::&lt;impl rustc_query_system::query::config::QueryAccessors&lt;rustc_middle::ty::context::TyCtxt&gt; for rustc_middle::ty::query::queries::collect_and_partition_mono_items&gt;::compute
  16: rustc_middle::dep_graph::&lt;impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind&gt;::with_deps
  17: rustc_query_system::dep_graph::graph::DepGraph&lt;K&gt;::with_task_impl
  18: rustc_data_structures::stack::ensure_sufficient_stack
  19: rustc_query_system::query::plumbing::get_query_impl
  20: rustc_codegen_ssa::base::codegen_crate
  21: &lt;rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend&gt;::codegen_crate
  22: rustc_interface::passes::QueryContext::enter
  23: rustc_interface::queries::Queries::ongoing_codegen
  24: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::enter
  25: rustc_span::with_source_map
  26: rustc_interface::interface::create_compiler_and_run
  27: scoped_tls::ScopedKey&lt;T&gt;::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&amp;template=ice.md

note: rustc 1.47.0-beta.1 (0f91f5c28 2020-08-25) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z macro-backtrace -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C codegen-units=8 -C debuginfo=1 -C debug-assertions=on -C overflow-checks=off -C incremental -C link-args=-Wl,-rpath,$ORIGIN/../lib -C prefer-dynamic -C llvm-args=-import-instr-limit=10 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: aborting due to previous error

   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::bug
   2: rustc_errors::Handler::bug
   3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
   4: rustc_middle::ty::context::tls::with_opt::{{closure}}
   5: rustc_middle::ty::context::tls::with_opt
   6: rustc_middle::util::bug::opt_span_bug_fmt
   7: rustc_middle::util::bug::bug_fmt
   8: rustc_mir::monomorphize::collector::should_codegen_locally
   9: &lt;rustc_mir::monomorphize::collector::MirNeighborCollector as rustc_middle::mir
``
</code></pre></div>



<a name="209442499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209442499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209442499">(Sep 08 2020 at 20:50)</a>:</h4>
<p><code>./x.py clean</code> fixes that, but I'd have expected that <code>rm -rf build</code> was enough?</p>



<a name="209442550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209442550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209442550">(Sep 08 2020 at 20:50)</a>:</h4>
<p>unsure where incr. compilation cache lives but I guess somewhere in build/</p>



<a name="209442578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209442578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209442578">(Sep 08 2020 at 20:50)</a>:</h4>
<p>anyway after clean I'm getting</p>



<a name="209442581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209442581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209442581">(Sep 08 2020 at 20:50)</a>:</h4>
<div class="codehilite"><pre><span></span><code>   Compiling rustc_typeck v0.0.0 (/home/santiago/src/oss/rust1/compiler/rustc_typeck)
error[E0463]: can&#39;t find crate for `std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `rustc_typeck`.
</code></pre></div>



<a name="209442593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209442593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209442593">(Sep 08 2020 at 20:50)</a>:</h4>
<p>unsure why all this is happening :/</p>



<a name="209443770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209443770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209443770">(Sep 08 2020 at 21:01)</a>:</h4>
<p>I ... that is unexpected</p>



<a name="209443805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209443805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209443805">(Sep 08 2020 at 21:01)</a>:</h4>
<p>are you using sccache or something like that?</p>



<a name="209443872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209443872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209443872">(Sep 08 2020 at 21:02)</a>:</h4>
<p>one theory might be that x.py is <em>not</em> prepared for parallel x.pys running, and your editor is running x.py check or something which is causing problems...</p>



<a name="209443946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209443946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209443946">(Sep 08 2020 at 21:02)</a>:</h4>
<p><span class="user-mention silent" data-user-id="138448">cuviper</span> <a href="#narrow/stream/131828-t-compiler/topic/ninja/near/209443805">said</a>:</p>
<blockquote>
<p>are you using sccache or something like that?</p>
</blockquote>
<p>:) ccache, I guess the problem is related to it?</p>



<a name="209443975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209443975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209443975">(Sep 08 2020 at 21:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/131828-t-compiler/topic/ninja/near/209443872">said</a>:</p>
<blockquote>
<p>one theory might be that x.py is <em>not</em> prepared for parallel x.pys running, and your editor is running x.py check or something which is causing problems...</p>
</blockquote>
<p>also that <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="209443982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209443982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209443982">(Sep 08 2020 at 21:03)</a>:</h4>
<p>may be</p>



<a name="209444022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209444022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209444022">(Sep 08 2020 at 21:03)</a>:</h4>
<p>after removing most of target dirs it ended working</p>



<a name="209444071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209444071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209444071">(Sep 08 2020 at 21:04)</a>:</h4>
<p>but I guess it's unrelated to that and maybe Mark's theory is right?</p>



<a name="209444512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209444512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209444512">(Sep 08 2020 at 21:08)</a>:</h4>
<p>I think regular ccache doesn't know rust, so I'd go with the editor <code>x.py</code> theory</p>



<a name="209444545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209444545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209444545">(Sep 08 2020 at 21:08)</a>:</h4>
<p>probably we should do the cargo thing and have a global lock :/</p>



<a name="209444692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209444692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209444692">(Sep 08 2020 at 21:10)</a>:</h4>
<p>Cargo's own lock will help to some extent, but not when bootstrap is copying new sysroots and such</p>



<a name="209444717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209444717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209444717">(Sep 08 2020 at 21:10)</a>:</h4>
<p>right, yeah</p>



<a name="209444884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209444884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209444884">(Sep 08 2020 at 21:12)</a>:</h4>
<p>I'm running <code>./x.py check</code> on save but I'm not sure how good this is for rustc</p>



<a name="209444941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209444941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209444941">(Sep 08 2020 at 21:12)</a>:</h4>
<p>it's fine if you don't kick off a x.py build in parallel to that</p>



<a name="209444973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209444973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209444973">(Sep 08 2020 at 21:12)</a>:</h4>
<p>but if you do, then who knows what can happen</p>



<a name="209444982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209444982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209444982">(Sep 08 2020 at 21:12)</a>:</h4>
<p>I was trying it out, I know others have tried or are using it?, interested in knowing from them but it doesn't seem very nice to me</p>



<a name="209445010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209445010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209445010">(Sep 08 2020 at 21:13)</a>:</h4>
<p>I have it on a separate keybind, not save</p>



<a name="209445020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209445020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209445020">(Sep 08 2020 at 21:13)</a>:</h4>
<p>it's too slow for just every save for me, I'm too use to saving often</p>



<a name="209445034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209445034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209445034">(Sep 08 2020 at 21:13)</a>:</h4>
<p>exactly that's why doesn't seem good to me</p>



<a name="209445445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/ninja/near/209445445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/ninja.html#209445445">(Sep 08 2020 at 21:16)</a>:</h4>
<p>/me wishes we could have x.py check in &lt;5 seconds, ideally ~1 second, but that's very far off</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>